// State Type
export interface UserProfile {
    uid: string;
    nickname: string;
    roles: Array<{ rid: string; rname: string }>;
}

export interface UserState {
    isLogin: boolean;
    token: string;
    profile: UserProfile;
    acls: string[];
}

// Action Contant
export const LOGIN_SUCCESS = "LOGIN_SUCCESS";
export const LOGOUT = "LOGOUT";

// Action Type
interface LogginSuccessAction {
    type: typeof LOGIN_SUCCESS;
    payload: UserState;
}

interface LogoutAction {
    type: typeof LOGOUT;
    payload?: undefined;
}

// All Actions
export type UserActionTypes = LogginSuccessAction | LogoutAction;
